#region using

using NHibernate;

using RealEstate.Utilities;

using System;
using System.Collections.Generic;
using System.Text;

#endregion

namespace RealEstate.Core
{
	public abstract class AbstractEntityManager : IEntityManager
	{
		#region IEntityManger Members

		public virtual void Create(IEntityObject entity)
		{

			ISession session = NHibernateHelper.GetCurrentSession();
			ITransaction transaction = session.BeginTransaction();

			session.Save(entity);
			transaction.Commit();

			NHibernateHelper.CloseSession();

		}

		public virtual void Update(IEntityObject entity)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		public virtual bool Delete(IEntityObject entity)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		public virtual ICollection<IEntityObject> Search(object options)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		#endregion

	}
}
